Completed
Push — develop ( e1f118...ebc3ca )
by Xaver
01:09
created

String.repeat   D

Complexity

Conditions 10
Paths 3

Size

Total Lines 38

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 10
c 1
b 0
f 0
nc 3
dl 0
loc 38
rs 4.8196
nop 1

How to fix   Complexity   

Complexity

Complex classes like String.repeat often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
'use strict';
2
3
require.config({
4
  baseUrl: 'lib',
5
  paths: {
6
    'polyglot': '../node_modules/node-polyglot/build/polyglot',
7
    'Navigo': '../node_modules/navigo/lib/navigo',
8
    'leaflet': '../node_modules/leaflet/dist/leaflet',
9
    'moment': '../node_modules/moment/moment',
10
    // d3 modules indirect dependencies
11
    // by d3-zoom: d3-drag
12
    'd3-ease': '../node_modules/d3-ease/build/d3-ease',
13
    'd3-transition': '../node_modules/d3-transition/build/d3-transition',
14
    'd3-color': '../node_modules/d3-color/build/d3-color',
15
    'd3-interpolate': '../node_modules/d3-interpolate/build/d3-interpolate',
16
    // by d3-force
17
    'd3-collection': '../node_modules/d3-collection/build/d3-collection',
18
    'd3-dispatch': '../node_modules/d3-dispatch/build/d3-dispatch',
19
    'd3-quadtree': '../node_modules/d3-quadtree/build/d3-quadtree',
20
    'd3-timer': '../node_modules/d3-timer/build/d3-timer',
21
    // by d3-drag: d3-selection
22
    // d3 modules dependencies
23
    'd3-selection': '../node_modules/d3-selection/build/d3-selection',
24
    'd3-force': '../node_modules/d3-force/build/d3-force',
25
    'd3-zoom': '../node_modules/d3-zoom/build/d3-zoom',
26
    'd3-drag': '../node_modules/d3-drag/build/d3-drag',
27
    'snabbdom': '../node_modules/snabbdom/dist/snabbdom-patch',
28
    'rbush': '../node_modules/rbush/rbush',
29
    'helper': 'utils/helper'
30
  },
31
  shim: {
32
    'd3-drag': ['d3-selection'],
33
    'd3-force': ['d3-collection', 'd3-dispatch', 'd3-quadtree', 'd3-timer'],
34
    'd3-interpolate': ['d3-color'],
35
    'd3-zoom': ['d3-drag', 'd3-ease', 'd3-transition', 'd3-interpolate']
36
  }
37
});
38
39
require(['main'], function (main) {
40
  main(jsonData);
41
});
42